<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>设备编号添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加信息':action=='Modify'?'修改信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'monitoring_equipment_detail', 'form': 'dataForm', 'primary_key':'Monitoring_Equipment_Detail_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">设备信息</div>
        </div>
        <el-descriptions :column="1" size="large" border>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">设备编号</div>
            </template>
            <el-input ref="Crop_Name" v-model="dataForm.Monitoring_Equipment_Detail_SerialNumber" class="borderless-input"
              placeholder="请输入设备编号" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">设备类型</div>
            </template>
            <el-cascader clearable v-model="dataForm.Monitoring_Equipment_SerialNumber" filterable :props="{value:'Monitoring_Equipment_SerialNumber',label:'Monitoring_Equipment_Name',children:'children',emitPath:false}"
              placeholder="请选择设备类型" :options="ME" style="width: 100%" class="borderless-input"></el-cascader>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">安装时间</div>
            </template>
            <el-date-picker v-model="dataForm.Install_Date" format="YYYY-MM-DD HH:mm:ss"
            value-format="YYYY-MM-DD HH:mm:ss" class="borderless-input" type="datetime" placeholder="请选择安装时间"
            size="large"></el-date-picker>
          </el-descriptions-item>
          <!-- <el-descriptions-item>
            <template #label>
              <div class="cell-item">省/市/区</div>
            </template>
            <el-cascader  @change="changeCity" v-model="dataForm.County_Nubmer" filterable
              class="borderless-input" :props="{value:'value',label:'label',children:'children',emitPath:false}"
              placeholder="请选择省市区乡镇" :options="city" style="width: 100%"></el-cascader>
          </el-descriptions-item> -->
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">乡镇/村庄</div>
            </template>
            <el-cascader @change="changeCity" v-model="dataForm.Village_Number" filterable
              class="borderless-input"
              :props="{value:'ProvinceNumber',label:'Province',children:'children',emitPath:false}"
              placeholder="请选择省市区乡镇" :options="city1" style="width: 100%"></el-cascader>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">坐标</div>
            </template>
            <el-input ref="Coordinate" v-model="dataForm.Coordinate" class="borderless-input" placeholder="请输入坐标" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">原始数据流url</div>
            </template>
            <el-input v-model="dataForm.Data_URL" class="borderless-input" placeholder="请输入原始数据流url" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">推流地址</div>
            </template>
            <el-input v-model="dataForm.Data_PushUrl" class="borderless-input" placeholder="请输入推流地址" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">预警值</div>
            </template>
            <el-input v-model="dataForm.WarningValue" class="borderless-input" placeholder="请输入预警值" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">外部设备ID</div>
            </template>
            <el-input v-model="dataForm.ExternalEquipmentID" class="borderless-input" placeholder="请输入外部设备ID" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">容量</div>
            </template>
            <el-input  v-model="dataForm.Capacity" class="borderless-input" placeholder="请输入容量" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">材质</div>
            </template>
            <el-input v-model="dataForm.Material" class="borderless-input" placeholder="请输入材质" />
          </el-descriptions-item>

          <el-descriptions-item>
            <template #label>
              <div class="cell-item">设备职能</div>
            </template>
         
            <el-select @change="handleChange" multiple clearable v-model.trim="dataForm.EquipmentViewTypeHtml" placeholder="请输入设备职能" filterable
              style="width: 100%">
              <el-option v-for="(item,index) in EquipmentViewTypeInfo" :key="index" :label="item.lable"
                :value="item.value"></el-option>
            </el-select>
          </el-descriptions-item>

          <el-descriptions-item>
            <template #label>
              <div class="cell-item">所属土地</div>
            </template>
            <el-select clearable v-model.trim="dataForm.Land_SerialNumber" placeholder="请选择所属土地" filterable
              style="width: 100%">
              <el-option v-for="(item,index) in land" :key="index" :label="item.Natural_Resource_Name"
                :value="item.Natural_Resource_SerialNumber"></el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">所属网格</div>
            </template>
            <el-select clearable v-model.trim="dataForm.Grid_SerialNumber" placeholder="请选择所属网格" filterable
              style="width: 100%">
              <el-option v-for="(item,index) in grid_information" :key="index" :label="item.Grid_Name"
                :value="item.Grid_SerialNumber"></el-option>
            </el-select>
          </el-descriptions-item>
        </el-descriptions>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">设备标签</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm}" ref="form1" inline-message="true" style="width: 100%">
            <el-descriptions
              :data-options="JSON.stringify({ 'TableName': 'monitoring_equipment_mapping_tags', 'form': 'childDataForm', 'ParentTableName': 'monitoring_equipment_detail'})"
              :column="3" size="large" border>
              <el-descriptions-item v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')"
                :key="index">
                <template #label>
                  <div class="cell-item">标签{{index + 1}}</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Monitoring_Equipment_Tags_SerialNumber'" :rules="[{ required: true, message: '请选择设备标签', trigger: 'blur' }]">
                  <el-select clearable v-model.trim="item.Monitoring_Equipment_Tags_SerialNumber" placeholder="请选择设备标签" filterable
                    style="width: 100%">
                    <el-option v-for="(item,index) in monitoring_equipment_tags" :key="index" :label="item.Monitoring_Equipment_Tags"
                      :value="item.Monitoring_Equipment_Tags_SerialNumber"></el-option>
                  </el-select>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
      
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>